// 删除用户个人动态

// 获得删除动态的按钮
let delDyBtn = document.getElementById("delDyBtn");

// 删除功能已绑定在绑定在详细动态中了，这个其实存不存在无所谓
delDyBtn.onclick = function(){
    let data = new FormData();
    //数据类型转化，如果输入非数字，得到NaN
    let idDeled = Number(prompt("请输入你要删除的动态ID:",""));
    data.append("id",idDeled);

    postForm(data,"dynamicState/delete").then(
        value=>{
            if(value.code == 200){
                console.log(value.msg);
                // 个人动态
                AllDyWapper.style.display = "none";
                lookPersonDy.click();
            }
            else if(value.code == 500){
                console.log(value.msg);
            }
            else{
                alert("后台又又又炸掉了！");
            }
        },
        reason=>{
        }
    ) 
}